package main

import (
    "fmt"
    "io/ioutil"
    "os"
    "strings"
)

func main() {
    cnt := make(map[string]int)
    for _, file := range os.Args[1:] {
        data, err := ioutil.ReadFile(file)
        if err != nil {
            fmt.Fprintf(os.Stderr, "dup3 %v\n", err)
            continue
        }

        for _, j := range strings.Split(string(data), "\n") {
            cnt[j]++
        }
    }

    for lines, i := range cnt {
        if i > 1 {
            fmt.Printf("%s\t%d\n", lines, i)
        }
    }
}
